package com.gitee.funcy.multiple.datasource.controller;

import com.gitee.funcy.multiple.datasource.domain.User;
import com.gitee.funcy.multiple.datasource.domain.query.UserQuery;
import com.gitee.funcy.multiple.datasource.service.IAppService;
import com.gitee.funcy.multiple.datasource.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * ｛这里添加描述｝
 *
 * @author funcy
 * @date 2019-09-25 21:45
 */
@Controller
@RequestMapping("/api/app")
public class AppController {

    @Autowired
    private IAppService appService;

    /**
     * 保存一条记录
     * @param appName
     * @param dataSource
     * @return
     */
    @ResponseBody
    @RequestMapping("save")
    public String save(String appName, String dataSource) {
        appService.save(appName, dataSource);
        return "success";
    }

    /**
     * 保存一条记录
     * @param appName
     * @param dataSource
     * @return
     */
    @ResponseBody
    @RequestMapping("saveMix")
    public String saveMix(String appName, String dataSource, String nick) {
        appService.saveMix(appName, dataSource, nick);
        return "success";
    }

}
